#pragma GCC optimize(2)
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 2e5 + 10;

int n;
char str[N];
int fa[30], ne[30], p[30];

void init(){
    for(int i = 0; i < 30; i ++){
        fa[i] = i, ne[i] = i, p[i] = i;
    }
}

int find(int x){
    if(x != p[x]){
        p[x] = find(p[x]);
    }
    return p[x];
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        init();
        int sz = 0;
        cin >> n;
        cin >> str;

        for(int i = 0; i < n; i ++){
            int t = str[i] - 'a';
            if(fa[t] != t) continue;
            for(int j = 0; j < 26; j ++){
                if(j == t)continue;
                if(ne[j] != j) continue;

                if((fa[j] != j && find(j) != t) || (fa[j] != j && find(j) == t && sz == 25) || fa[j] == j){
                    fa[t] = j;
                    ne[j] = t;
                    p[t] = j;
                    sz ++;
                    break;
                }
            }
        }

        for(int i = 0; i < n; i ++){
            int t = str[i] - 'a';
            char k = fa[t] + 'a';
            cout << k;
        }
        cout << '\n';
    }

    


    return 0;
}